//
//  common.swift
//  WBBeta1
//
//  Created by wustzhy on 16/8/10.
//  Copyright © 2016年 Yestin. All rights reserved.
//

import Foundation

import UIKit

// 微博帐号、密码
let WBName = "88fishyu@163.com"
let WBPassWd = "123465789"
// 微博相关信息
let WBAppkey = "504550724"
let WBAppSecret = "78db5593d11bc25e5b2e0202d7b1fa72"
let WBRedirect_uri = "https://www.baidu.com"

// 主题颜色
let AppThemeColor = UIColor.orangeColor()
// 切换根视图控制器
let WBSWITCHROOTVCNOTIFICATION = "WBSWITCHROOTVCNOTIFICATION"

// 屏幕的宽&高
let SCREENW = UIScreen.mainScreen().bounds.width
let SCREENH = UIScreen.mainScreen().bounds.height

//RGB颜色
func RGB(red:CGFloat, green:CGFloat,blue:CGFloat, alpha:CGFloat = 1) -> UIColor{
    return UIColor(red: red/255, green: green/255, blue: blue/255, alpha: alpha)
}
// 随机颜色
func RandomColor()-> UIColor{
    let r = CGFloat(random()%256)
    let g = CGFloat(random()%256)
    let b = CGFloat(random()%256)
    return RGB(r, green: g, blue: b)
}
/**
 自定义打印
 
 - parameter message:  内容
 - parameter file:     类名
 - parameter function: 方法名
 - parameter line:     行数
 */
func printLog<T>(message: T, file: String = __FILE__, function: String = __FUNCTION__,line: Int =  __LINE__){
    #if DEBUG
        let newFile = (file as NSString).lastPathComponent
//        let result = "\(newFile) [\(line)] \(function) : \(message)"
        let result = "\(newFile) [\(line)] : \(message)"
        print(result)
    #endif
}

